import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/wb";

// 查询考试时间
export function listSchedules(data) {
  return request({
    url: '/exams/schedules/list',
    method: 'post',
    data
  })
}
// 考试时间详细
export function getSchedules(id) {
  return request({
    url: '/exams/schedules/' + parseStrEmpty(id),
    method: 'get'
  })
}

// 新增考试时间
export function addSchedules(data) {
  return request({
    url: '/exams/schedules/add',
    method: 'post',
    data
  })
}

// 修改考试时间
export function updateSchedules(data) {
  return request({
    url: '/exams/schedules/update',
    method: 'post',
    data
  })
}

// 删除考试时间（支持批量）
export function delSchedules(idOrIds) {
  const ids = Array.isArray(idOrIds) ? idOrIds : [idOrIds]
  return request({
    url: '/exams/schedules/deleteAll',
    method: 'delete',
    data: { ids }
  })
}

